#searchbar {
	z-index: 99;
	position: fixed;
	top: 2.25em;
	left: 0;
	width: 100%;
	background: #fff;
	color: #000;
	padding-left: 75px;
	padding-right: 82px;
	/* align with window controls */
	-webkit-user-select: none;
	max-height: calc(100% - 75px);
	overflow-y: auto;
	will-change: display;
}

/* the navbar gets moved over in fullscreen, but the searchbar still needs to be aligned with it */

body.fullscreen #searchbar,
body.notMac #searchbar {
	padding-left: 0;
}
.searchbar-item {
	width: 100%;
	display: block;
	padding: 0.55em 0.55em 0.55em 9px;
	cursor: pointer;
	transition: 0.2s transform, 0.2s opacity;
}
.searchbar-item:after {
	content: "";
	clear: both;
	display: block;
}
.searchbar-item:hover {
	background-color: rgba(0, 0, 0, 0.04);
}
.searchbar-item:focus,
.searchbar-item.fakefocus {
	background-color: rgba(0, 0, 0, 0.08);
	outline: none;
}
.dark-theme .theme-background-color .searchbar-item:hover {
	background-color: rgba(255, 255, 255, 0.08);
}
.dark-theme .theme-background-color .searchbar-item:focus,
.dark-theme .theme-background-color .searchbar-item.fakefocus {
	background-color: rgba(255, 255, 255, 0.14);
}
.searchbar-item .title {
	display: inline-block;
	vertical-align: middle;
	max-width: 45%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.searchbar-item .title.title-block {
	display: block;
	max-width: 100%;
}
.searchbar-item i,
.searchbar-item .icon-image {
	opacity: 0.25;
	font-size: 0.9em;
	margin-right: 1em;
	margin-left: -2em;
	vertical-align: text-bottom;
	width: 1em;
	height: 1em;
}
.searchbar-item .icon-image {
	opacity: 1.0;
}
.dark-theme .theme-background-color .searchbar-item i {
	opacity: 0.33;
}

/* move the icon when there isn't room to the left of the searchbar */

.fullscreen .searchbar-item i,
.notMac .searchbar-item i,
.fullscreen .searchbar-item .icon-image,
.notMac .searchbar-item .icon-image {
	margin-left: 0;
	float: right;
}
.searchbar-item .image {
	height: 2.75em;
	margin: 0.25em 0.5em 0.5em 0;
	float: left;
}
.searchbar-item:focus .image {
	height: 4em;
}
#searchbar .image.color-circle {
	width: 1.8em;
	height: 1.8em;
	border-radius: 50%;
	float: left;
	border: 1px solid rgba(0, 0, 0, 0.2);
	padding-right: 0.5em;
}
.dark-theme #searchbar .image.color-circle {
	border-color: rgba(255, 255, 255, 0.2);
}
.searchbar-item .secondary-text .md-info {
	float: left;
	opacity: 0.8;
	font-size: inherit;
}
.searchbar-item .secondary-text .md-info:first-child {
	padding-left: 0;
}
.searchbar-item .secondary-text .md-info:last-of-type {
	padding-right: 0.5em;
}
.searchbar-item .secondary-text .md-info + .md-info:before {
	content: " - ";
}
.searchbar-item .secondary-text {
	display: inline-block;
	opacity: 0.66;
	font-size: 0.95em;
	overflow: hidden;
	vertical-align: middle;
	padding-left: 1.5em;
	max-width: 50%;
	white-space: nowrap;
	text-overflow: ellipsis;
	max-height: 2em;
}

/* switch to a two-line layout */

@media all and (max-width: 650px) {
	.searchbar-item .title {
		max-width: calc(100% - 50px);
	}
	.searchbar-item .secondary-text {
		display: block;
		max-width: 100%;
		padding-top: 0.1em;
		padding-left: 0;
		/* prevents letters like "g" from being cut off */
		line-height: 1em;
	}
	.searchbar-item .low-priority-image {
		display: none;
	}
}
.searchbar-item .description-block {
	display: block;
	line-height: 1.15em;
	max-height: 2.2em;
	overflow: hidden;
	opacity: 0.666;
	font-size: 0.85em;
}
.searchbar-item .attribution {
	display: none;
	line-height: 1.15em;
	font-size: 0.85em;
	opacity: 0.6;
	margin-top: 0.2em;
}
.searchbar-item:focus .attribution {
	display: block;
}

/* when a result is selected, we can show more of the description */

.searchbar-item:focus .description-block {
	max-height: 6.6em;
}
body.is-edit-mode webview {
	opacity: 0.5;
}

/* tag searches */

.searchbar-item.tag {
	display: inline-block;
	width: auto;
	background-color: rgba(0, 0, 0, 0.04);
	margin: 0.75em 0.5em;
	border-radius: 3px;
	padding-right: 1em;
}
.searchbar-item.tag .title {
	max-width: 100%;
}
.searchbar-item.tag:focus {
	background: rgba(0, 0, 0, 0.08);
}
.dark-theme .theme-background-color .searchbar-item.tag {
	background-color: rgba(255, 255, 255, 0.08);
}
.dark-theme .theme-background-color .searchbar-item.tag:focus {
	background-color: rgba(255, 255, 255, 0.12);
}
